<?php

namespace App\Policies;

use App\Models\Blog;
use App\Models\User;
use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Support\Facades\Auth;

class BlogsPolicy
{
    use HandlesAuthorization;

    /**
     * Create a new policy instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

//    public function destroy(User $user,Blog $blog)
//    {
//        return   $blog->user_id === $user->id;
//    }

    public function destroy(User $user,Blog $blog)
    {
        return   $blog->user_id === Auth::user()->id;
    }


//    public function destroy(User $user, Status $status)
//    {
//        return $user->id === $status->user_id;
//    }
}
